package validatorcustom;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import validatormethod.MyService;
import validatormethod.User;
import validatormethod.ValidationConfig;

public class TestUser {
    public static void main(String[] args) {
        ApplicationContext context =
                new AnnotationConfigApplicationContext(ValidationConfig.class);
        MyService service = context.getBean(MyService.class);
        User user = new User();
        user.setName("bao");
        user.setAge(11);
        user.setPhone("13011111111");
//        user.setMessage("test a code");
        service.testMethod(user);
    }
}
